home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgramD2.iso / Borland / Borland C++ V5.02 / OWLINC.PAK / OLEFRAME.H < prev    next >
C/C++ Source or Header  |  1997-05-06  |  4KB  |  140 lines

  1. //----------------------------------------------------------------------------
  2. // ObjectWindows
  3. // Copyright (c) 1994, 1997 by Borland International, All Rights Reserved
  4. //
  5. //$Revision:   10.3  $
  6. //
  7. //----------------------------------------------------------------------------
  8. #if !defined(OWL_OLEFRAME_H)
  9. #define OWL_OLEFRAME_H
  10.  
  11. #if !defined(OWL_DECFRAME_H)
  12. # include <owl/decframe.h>
  13. #endif
  14. #if !defined(OWL_OCFEVENT_H)
  15. # include <owl/ocfevent.h>
  16. #endif
  17. #if !defined(OCF_OCREG)
  18. # include <ocf/ocreg.h>
  19. #endif
  20. #if !defined(OWL_OLEFACTO_H)
  21. # include <owl/olefacto.h>
  22. #endif
  23.  
  24. #if defined(BI_NAMESPACE)
  25. namespace OCF {
  26. #endif
  27.  
  28. class TOcMenuDescr;
  29. class _ICLASS TOcApp;
  30.  
  31. #if defined(BI_NAMESPACE)
  32. } // namespace OCF
  33. #endif
  34.  
  35.  
  36. #if defined(BI_NAMESPACE)
  37. namespace OWL {
  38. #endif
  39.  
  40. // Generic definitions/compiler options (eg. alignment) preceeding the 
  41. // definition of classes
  42. #include <services/preclass.h>
  43.  
  44. //
  45. // pad decorations IDs, 4 total: 32042, 32043, 32044, 32045
  46. //
  47. const int IDW_PADDECORATION = 32042;
  48. const int IDW_REMVIEWBUCKET = 32046;  // Window id for remote view holder
  49. const int IDT_DLLIDLE       = 32000;  // Idle timer ID for DLL servers
  50.  
  51. //
  52. // class TOleFrame
  53. // ~~~~~ ~~~~~~~~~
  54. // Decorated frame that supports OLE 2 using OCF
  55. //
  56. class _USERCLASS TOleFrame : public TDecoratedFrame {
  57.   public:
  58.     TOleFrame(const char far* title,
  59.               TWindow*        clientWnd,
  60.               bool            trackMenuSelection = false,
  61.               TModule*        module = 0);
  62.    ~TOleFrame();
  63.     TOcApp*    GetOcApp();
  64.     void       SetOcApp(TOcApp* app);
  65.     void       AddUserFormatName(const char far* name, const char far* resultName, const char far* id);
  66.  
  67.     TWindow*   GetRemViewBucket();
  68.     void       OleViewClosing(bool close);
  69.  
  70.   protected:
  71.     void       SetupWindow();
  72.     void       CleanupWindow();
  73.     void       Destroy(int retVal);
  74.  
  75.     void       EvSize(uint sizeType, TSize& size);
  76.     void       EvActivateApp(bool active, HTASK hTask);
  77.     void       EvTimer(uint timerId);
  78.  
  79.     TResult    EvOcEvent(TParam1 param1, TParam2 param2);
  80.     bool       EvOcAppInsMenus(TOcMenuDescr far& sharedMenu);
  81.     bool       EvOcAppMenus(TOcMenuDescr far& md);
  82.     bool       EvOcAppProcessMsg(MSG far* msg);
  83.     bool       EvOcAppFrameRect(TRect far* rect);
  84.     bool       EvOcAppBorderSpaceReq(TRect far* rect);
  85.     bool       EvOcAppBorderSpaceSet(TRect far* rect);
  86.     void       EvOcAppStatusText(const char far* rect);
  87.     void       EvOcAppRestoreUI();
  88.     void       EvOcAppDialogHelp(TOcDialogHelp far& dh);
  89.     bool       EvOcAppShutdown();
  90.  
  91.   protected:
  92.     TOcApp*    OcApp;
  93.     TMenu      StashedContainerPopups;
  94.     int        StashCount;
  95.     void       StashContainerPopups(const TMenuDescr& shMenuDescr);
  96.     void       DestroyStashedPopups();
  97.     HMENU      HOldMenu;
  98.  
  99.   private:
  100.     enum {
  101.       DontCare, UserInitiated, ViewInitiated, ServerInitiated
  102.     } OcShutDown;
  103.  
  104.   DECLARE_RESPONSE_TABLE(TOleFrame);
  105. };
  106.  
  107. // Generic definitions/compiler options (eg. alignment) following the 
  108. // definition of classes
  109. #include <services/posclass.h>
  110.  
  111. #if defined(BI_NAMESPACE)
  112. } // namespace OWL
  113. #endif
  114.  
  115. // --------------------------------------------------------------------------
  116. // Inline implementations
  117. //
  118.  
  119. //
  120. inline TOcApp*
  121. TOleFrame::GetOcApp()
  122. {
  123.   return OcApp;
  124. }
  125.  
  126. //
  127. inline TWindow*
  128. TOleFrame::GetRemViewBucket()
  129. {
  130.   return ChildWithId(IDW_REMVIEWBUCKET);
  131. }
  132.  
  133. //
  134. inline void
  135. TOleFrame::EvOcAppDialogHelp(TOcDialogHelp far& dh)
  136. {
  137. }
  138.  
  139. #endif  // OWL_OLEFRAME_H
  140.